//
//  ConiditionDetailCollectionCell.m
//  CwinCar
//
//  Created by dlios on 15/10/26.
//  Copyright © 2015年 dlios. All rights reserved.
//

#import "ConiditionDetailCollectionCell.h"

@implementation ConiditionDetailCollectionCell
-(instancetype)initWithFrame:(CGRect)frame
{
    if ([super initWithFrame:frame]) {
        self.imageV = [[UIImageView alloc]initWithFrame:CGRectMake(10*suitableScreen_Width, 0, (mainScreen_Width-suitableScreen_Width*30)/2-20*suitableScreen_Width, mainScree_Height/9)];
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*suitableScreen_Width,mainScree_Height/9, (mainScreen_Width-suitableScreen_Width*30)/2-20*suitableScreen_Width, mainScree_Height/18)];
        self.priceLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*suitableScreen_Width, mainScree_Height/6, (mainScreen_Width-suitableScreen_Width*30)/2-20*suitableScreen_Width, mainScree_Height/18)];
        self.leixingLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*suitableScreen_Width, mainScree_Height*2/9, (mainScreen_Width-suitableScreen_Width*30)/2-20*suitableScreen_Width, mainScree_Height/27)];
        self.conditionLabel = [[UILabel alloc]initWithFrame:CGRectMake(10*suitableScreen_Width, mainScree_Height*7/27, (mainScreen_Width-suitableScreen_Width*30)/2-35*suitableScreen_Width, mainScree_Height/18)];
//        self.priceLabel.backgroundColor = [UIColor redColor];
        self.leixingLabel.font = [UIFont systemFontOfSize:12.];
        self.priceLabel.textColor = [UIColor orangeColor];
        self.nameLabel.textColor = [UIColor colorWithRed:0.24 green:0.24 blue:0.25 alpha:1];
        self.leixingLabel.textColor = [UIColor colorWithRed:0.24 green:0.24 blue:0.25 alpha:1];
        self.conditionLabel.backgroundColor = [UIColor colorWithRed:0.31 green:0.69 blue:0.9 alpha:1];
        self.conditionLabel.textColor = [UIColor whiteColor];
      
        [self.contentView addSubview:self.imageV];
        [self.contentView addSubview:self.nameLabel];
        [self.contentView addSubview:self.priceLabel];
        [self.contentView addSubview:self.leixingLabel];
        [self.contentView addSubview:self.conditionLabel];
        
        
    }
    return self;
}
-(void)cellData:(ConditionModel *)model
{
    self.nameLabel.text = model.seriesName;
    self.leixingLabel.text = model.subBrandName;
    self.priceLabel.text = [model.seriesPriceLow.stringValue stringByAppendingString:[NSString stringWithFormat:@" - %@",model.seriesPriceHigh]];
    
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:model.seriesImg]placeholderImage:[UIImage imageNamed:@"zhanweitu"]];
    
    self.conditionLabel.text = [NSString stringWithFormat:@"%@款符合你的条件",model.carNumber];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
